/******************************************************************************
/
/  Authors:
/           Ilan   Bar Magen 
/    		Shalev Mintz      066078189  shalevmi@t2  
/
/  Submition date: 9/7/2008
/
/  This file contains:
/
/
******************************************************************************/

#ifndef POPE_H 
#define POPE_H


#include "DSL.h"

#include<cstdlib>  // for NULL
#include<iostream>

using namespace std;


class Town {
private:
	int ID;
	//int tax;
	int salary;

public:
	Town(int _ID, int _salary):
	 ID(_ID), salary(_salary) {}

	int  GetID()       const {return ID;}
	int  GetSalary()    const {return salary;}
	
	void SetID(int id)        {ID = id; return;}
	void SetSalary(int st)     {salary = st; return;}
};


SL_RESULT Release_data(Town** dat);


template <class D, class K>
class EuroPope {
private:
    int MaccabiFans,
		HapoelFans;
public:
	Stand(): DRSkip_List<D,K>(INT_MAX, INT_MIN) {MaccabiFans = HapoelFans = 0;}

	int getMaccabiFans() const {return MaccabiFans;}
	int getHapoelFans()  const {return HapoelFans;}

	void IncTeam(int tm) 
	{
		if (tm ==  0) ++MaccabiFans;
		else ++HapoelFans;
	}

	void DecTeam(int tm) 
	{
		if (tm ==  0) --MaccabiFans;
		else --HapoelFans;
	}

};



class EuroPope{
private:
	DRSkip_List<Town*,int> TownsDRSL; 
	//declare UF<Town*,int> CitizensUF
public:
	EuroPope(): TownsDRSL(INT_MAX, INT_MIN) {}
	~EuroPope() {
		TownsDRSL.For_Each_Node(Release_data); //TODO check result
		//delete[] Stands;
	};  

	StatusType newFan(int id, int stand, int chair, int team);
	StatusType banFan(int stand, int chair);
	StatusType getChair(int id, int * stand, int * chair);
	StatusType getNumMaccabiFans(int stand, int * numFans);
	StatusType getNumHapoelFans(int stand, int * numFans);
	StatusType getNumFreeChairs(int stand, int chair, int * freeChairs);
	StatusType separateStands(int stand1, int stand2);
	int        isImplementingBonus() const {return 0;}
};




#endif //STADIUM_H
